home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / intuisup.lha / Intuisup / source.lha / Render / render.h < prev   
C/C++ Source or Header  |  1992-09-14  |  6KB  |  152 lines

  1. /* $Revision Header *** Header built automatically - do not edit! ***********
  2.  *
  3.  *    (C) Copyright 1991 by Torsten Jürgeleit
  4.  *
  5.  *    Name .....: render.h
  6.  *    Created ..: Thursday 19-Dec-91 15:14:39
  7.  *    Revision .: 4
  8.  *
  9.  *    Date        Author                 Comment
  10.  *    =========   ====================   ====================
  11.  *    14-Sep-92   Torsten Jürgeleit      open_window(): new flag to prevent
  12.  *                       adding of inner window offsets
  13.  *    28-Jul-92   Torsten Jürgeleit      open window centered over position
  14.  *                       of mouse pointer
  15.  *    12-May-92   Torsten Jürgeleit      text colors for IClearWindow()
  16.  *    30-Apr-92   Torsten Jürgeleit      raster for clear_window()
  17.  *    19-Dec-91   Torsten Jürgeleit      Created this file!
  18.  *
  19.  ****************************************************************************
  20.  *
  21.  *    Defines, structures, prototypes and pragmas for render functions
  22.  *
  23.  * $Revision Header ********************************************************/
  24.  
  25. #ifndef    ISUP_RENDER_H
  26. #define    ISUP_RENDER_H
  27.  
  28.     /* ID for ISUP structures and intuition messages */
  29.  
  30. #define ISUP_ID        ((ULONG)'I' << 24 | (ULONG)'S' << 16 | 'U' << 8 | 'P')
  31.  
  32.     /* Defines for render info flags */
  33.  
  34. #define RENDER_INFO_FLAG_INNER_WINDOW        (1 << 0)   /* use upper left corner of inner window as location (0,0) */
  35. #define RENDER_INFO_FLAG_BACK_FILL        (1 << 1)   /* fill window back ground with different color */
  36. #define RENDER_INFO_FLAG_AVAIL_FONTS        (1 << 2)   /* scan available fonts and use this list for ask_font/open_font */
  37.  
  38.     /* Defines for open window flags */
  39.  
  40. #define OPEN_WINDOW_FLAG_CENTER_SCREEN        (1 << 0)   /* center window on screen */
  41. #define OPEN_WINDOW_FLAG_RENDER_PENS        (1 << 1)   /* use render pens for detail and backfill pen */
  42. #define OPEN_WINDOW_FLAG_CENTER_MOUSE        (1 << 2)   /* center window over current position of mouse pointer */
  43. #define OPEN_WINDOW_FLAG_NO_INNER_WINDOW    (1 << 3)   /* don't add inner window offsets for RENDER_INFO_FLAG_INNER_WINDOW */
  44.  
  45.     /* Defines for clear window flags */
  46.  
  47. #define CLEAR_WINDOW_FLAG_CUSTOM_DRAW_MODE    (1 << 0)   /* don't change draw mode */
  48. #define CLEAR_WINDOW_FLAG_CUSTOM_COLOR        (1 << 1)   /* don't change background color */
  49. #define CLEAR_WINDOW_FLAG_NORMAL_COLOR        (1 << 2)   /* use normal background color */
  50. #define CLEAR_WINDOW_FLAG_USE_RASTER        (1 << 3)   /* use standard raster for window background */
  51. #define CLEAR_WINDOW_FLAG_ABSOLUTE_POS        (1 << 4)   /* don't add window border offset to given upper left position */
  52. #define CLEAR_WINDOW_FLAG_TEXT1_COLOR        (1 << 5)   /* use text color 1 */
  53. #define CLEAR_WINDOW_FLAG_TEXT2_COLOR        (1 << 6)   /* use text color 2 */
  54.  
  55.     /* Defines for internal use only */
  56.  
  57. #define MAX_RENDER_COLORS    16    /* max screen colors to look at */
  58. #define MAX_RENDER_IMAGES    11
  59.  
  60. #define IMAGE_ARROW_LEFT    0
  61. #define IMAGE_ARROW_RIGHT    1
  62. #define IMAGE_ARROW_UP        2
  63. #define IMAGE_ARROW_DOWN    3
  64. #define IMAGE_KNOB_UNSELECTED    4
  65. #define IMAGE_KNOB_SELECTED    5
  66. #define IMAGE_CHECK_UNSELECTED    6
  67. #define IMAGE_CHECK_SELECTED    7
  68. #define IMAGE_CYCLE        8
  69. #define IMAGE_COUNT_LEFT    9
  70. #define IMAGE_COUNT_RIGHT    10
  71.  
  72. #define IMAGE_ARROW_WIDTH    9    /* fixed dimensions for images */
  73. #define IMAGE_ARROW_HEIGHT    5
  74. #define IMAGE_ARROW_DEPTH    1
  75.  
  76. #define IMAGE_KNOB_WIDTH    18
  77. #define IMAGE_KNOB_HEIGHT    9
  78. #define IMAGE_KNOB_DEPTH    2
  79.  
  80. #define IMAGE_CHECK_WIDTH    13
  81. #define IMAGE_CHECK_HEIGHT    7
  82. #define IMAGE_CHECK_DEPTH    1
  83.  
  84. #define IMAGE_CYCLE_WIDTH    16
  85. #define IMAGE_CYCLE_HEIGHT    9
  86. #define IMAGE_CYCLE_DEPTH    2
  87.  
  88. #define IMAGE_COUNT_WIDTH    8
  89. #define IMAGE_COUNT_HEIGHT    5
  90. #define IMAGE_COUNT_DEPTH    1
  91.  
  92. #define IMAGE_HORIZ_OFFSET    4
  93. #define IMAGE_VERT_OFFSET    2
  94.  
  95. #define INTUISUP_DATA_END    0    /* end marker for data arrays */
  96.  
  97.     /* Structures */
  98.  
  99. struct RenderInfo {
  100.     LONG    ri_ID;        /* id = 'ISUP' */
  101.     struct Screen  *ri_Screen;
  102.     USHORT    ri_ScreenWidth;
  103.     USHORT    ri_ScreenHeight;
  104.     UBYTE    ri_ScreenDepth;
  105.     UBYTE    ri_WindowBorderTop;
  106.     UBYTE    ri_WindowBorderLeft;
  107.     UBYTE    ri_WindowBorderRight;
  108.     UBYTE    ri_WindowBorderBottom;
  109.     UBYTE    ri_HighlightPen;
  110.     UBYTE    ri_ShadowPen;
  111.     UBYTE    ri_TextPen1;
  112.     UBYTE    ri_TextPen2;
  113.     UBYTE    ri_BackPen;
  114.     USHORT    ri_Flags;
  115.     ULONG    ri_ImageDataSize;
  116.     USHORT    *ri_ImageData;
  117.     ULONG    ri_AvailFontsHeaderSize;
  118.     struct AvailFontsHeader  *ri_AvailFontsHeader;
  119.     struct TextFont          *ri_TextFont;
  120.     struct TextAttr          ri_TextAttr;
  121.     struct Image             ri_Images[MAX_RENDER_IMAGES];
  122. };
  123.     /* Global prototypes */
  124.  
  125. struct RenderInfo  *get_render_info(struct Screen  *screen, USHORT flags);
  126. SHORT calc_color_difference(SHORT color1, SHORT color2);
  127. VOID  free_render_info(struct RenderInfo  *ri);
  128. struct Window  *open_window(struct RenderInfo  *ri, struct NewWindow  *nw,
  129.                                   USHORT flags);
  130. VOID clear_window(struct RenderInfo  *ri, struct Window  *win,
  131.          USHORT left_edge, USHORT top_edge, USHORT width, USHORT height,
  132.                                   USHORT flags);
  133. VOID close_window(struct Window  *win, BOOL more_windows);
  134. struct AvailFontsHeader  *avail_fonts(struct RenderInfo  *ri);
  135. struct TextAttr          *ask_font(struct RenderInfo  *ri,
  136.                               struct TextAttr  *ta);
  137. struct TextFont          *open_font(struct RenderInfo  *ri,
  138.                               struct TextAttr  *ta);
  139.     /* Global pragmas (Aztec C v5.2a) */
  140.  
  141. #pragma intfunc(get_render_info(a0,d0))
  142. #pragma regcall(calc_color_difference(d0,d1))   /* internal function */
  143. #pragma intfunc(free_render_info(a0))
  144. #pragma intfunc(open_window(a0,a1,d0))
  145. #pragma intfunc(clear_window(a0,a1,d0,d1,d2,d3,d4))
  146. #pragma intfunc(close_window(a0,d0))
  147. #pragma intfunc(avail_fonts(a0))
  148. #pragma intfunc(ask_font(a0,a1))
  149. #pragma intfunc(open_font(a0,a1))
  150.  
  151. #endif   /* ISUP_RENDER_H */
  152.